Install packages if necessary. Listed are installers for packages not on CRAN and the devlopment (most up-to-date) version of STEPS.
# library(devtools)
# install_github("steps-dev/steps")
# install_github("smwindecker/gdaltools")
Load packages
library(raster)
library(dplyr)
library(tibble)
library(sf)
library(rgdal)
library(readr)
library(readxl)
library(ggplot2)
library(lubridate)
library(magrittr)
library(tidyr)
library(foreach)
library(doMC)
library(future)
library(future.apply)
library(tidyr)
library(dismo)
library(gbm)
library(steps)
library(gdaltools)
source(file = "R/functions/pg.sf.R")
source(file = "R/functions/pg.pa.R")
source(file = "R/functions/read.vba.R")
source(file = "R/functions/proc.vba.R")
source(file = "R/functions/get.landis.vars.R")
source(file = "R/functions/rascc.R")
source(file = "R/functions/read.multi.line.header.R")
source(file = "R/functions/interpolate.climdat.R")
source(file = "R/functions/get.rst.prop.R")
source(file = "R/functions/get.rst.dat.R")
proj_path <- "/home/landis/rfst/"
# proj_path <- "D:/Users/ryan/Dropbox/Work/RFA_STEPS/rfst/"
ntimesteps <- 50
ncores <- 20
Set up base landscape layer
ch_rst <- raster(x = "data/grids/eco_v12.img") %T>%
plot
ch_proj <- ch_rst@crs
ch_extent <- extent(ch_rst)
ch_res <- res(ch_rst)
rfa <- read_sf("data/shapefiles/RFA/")%>%
st_transform(crs = ch_proj)
rfa
Simple feature collection with 81 features and 7 fields
geometry type: POLYGON
dimension: XY
bbox: xmin: -57985.97 ymin: 5665387 xmax: 763088.7 ymax: 6223446
epsg (SRID): NA
proj4string: +proj=utm +zone=55 +south +ellps=GRS80 +towgs84=0,0,0,-0,-0,-0,0 +units=m +no_defs